function paths = dfs2(adjacency_matrix, visited_nodes, end_node, paths, level)

neighbours = get_neighbour_nodes(adjacency_matrix, visited_nodes(end));

if level > 0
    index = ceil(rand() * length(neighbours));
    neighbours = [neighbours(index)];
end
    
for i=1:length(neighbours)
    node = neighbours(i);
    if any(visited_nodes(:) == node)
        continue
    end
    if node == end_node
        visited_nodes(end+1) = node;
        paths{end + 1} = visited_nodes;
        visited_nodes
        visited_nodes = visited_nodes(1:end-1);
        break
    end
end


for i=1:length(neighbours)
    node = neighbours(i);
    
    if length(visited_nodes) > 100
        break
    end
    
    if any(visited_nodes(:) == node) | node == end_node
        continue
    end
    
     visited_nodes(end+1) = node;
     if length(paths) < 20
     %if level == 0
        paths = dfs2(adjacency_matrix, visited_nodes, end_node, paths, level + 1);
     else
         break
     end
     visited_nodes = visited_nodes(1:end-1);
end

end